﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace UniRx
{
	// Token: 0x020003A5 RID: 933
	[Serializable]
	public struct Tuple<T1, T2> : IStructuralEquatable, IStructuralComparable, IComparable, ITuple, IEquatable<Tuple<T1, T2>>
	{
		// Token: 0x060012DD RID: 4829 RVA: 0x00056810 File Offset: 0x00054C10
		public Tuple(T1 item1, T2 item2)
		{
			this.item1 = item1;
			this.item2 = item2;
		}

		// Token: 0x1700012E RID: 302
		// (get) Token: 0x060012DE RID: 4830 RVA: 0x00056820 File Offset: 0x00054C20
		public T1 Item1
		{
			get
			{
				return this.item1;
			}
		}

		// Token: 0x1700012F RID: 303
		// (get) Token: 0x060012DF RID: 4831 RVA: 0x00056828 File Offset: 0x00054C28
		public T2 Item2
		{
			get
			{
				return this.item2;
			}
		}

		// Token: 0x060012E0 RID: 4832 RVA: 0x00056830 File Offset: 0x00054C30
		int IComparable.CompareTo(object obj)
		{
			return ((IStructuralComparable)this).CompareTo(obj, Comparer<object>.Default);
		}

		// Token: 0x060012E1 RID: 4833 RVA: 0x00056848 File Offset: 0x00054C48
		int IStructuralComparable.CompareTo(object other, IComparer comparer)
		{
			if (other == null)
			{
				return 1;
			}
			if (!(other is Tuple<T1, T2>))
			{
				throw new ArgumentException("other");
			}
			Tuple<T1, T2> tuple = (Tuple<T1, T2>)other;
			int num = comparer.Compare(this.item1, tuple.item1);
			if (num != 0)
			{
				return num;
			}
			return comparer.Compare(this.item2, tuple.item2);
		}

		// Token: 0x060012E2 RID: 4834 RVA: 0x000568BD File Offset: 0x00054CBD
		public override bool Equals(object obj)
		{
			return ((IStructuralEquatable)this).Equals(obj, EqualityComparer<object>.Default);
		}

		// Token: 0x060012E3 RID: 4835 RVA: 0x000568D8 File Offset: 0x00054CD8
		bool IStructuralEquatable.Equals(object other, IEqualityComparer comparer)
		{
			if (!(other is Tuple<T1, T2>))
			{
				return false;
			}
			Tuple<T1, T2> tuple = (Tuple<T1, T2>)other;
			return comparer.Equals(this.item1, tuple.item1) && comparer.Equals(this.item2, tuple.item2);
		}

		// Token: 0x060012E4 RID: 4836 RVA: 0x0005693C File Offset: 0x00054D3C
		public override int GetHashCode()
		{
			EqualityComparer<T1> @default = EqualityComparer<T1>.Default;
			EqualityComparer<T2> default2 = EqualityComparer<T2>.Default;
			int hashCode = @default.GetHashCode(this.item1);
			return (hashCode << 5) + hashCode ^ default2.GetHashCode(this.item2);
		}

		// Token: 0x060012E5 RID: 4837 RVA: 0x00056978 File Offset: 0x00054D78
		int IStructuralEquatable.GetHashCode(IEqualityComparer comparer)
		{
			int hashCode = comparer.GetHashCode(this.item1);
			return (hashCode << 5) + hashCode ^ comparer.GetHashCode(this.item2);
		}

		// Token: 0x060012E6 RID: 4838 RVA: 0x000569B0 File Offset: 0x00054DB0
		string ITuple.ToString()
		{
			return string.Format("{0}, {1}", this.item1, this.item2);
		}

		// Token: 0x060012E7 RID: 4839 RVA: 0x000569D2 File Offset: 0x00054DD2
		public override string ToString()
		{
			return "(" + ((ITuple)this).ToString() + ")";
		}

		// Token: 0x060012E8 RID: 4840 RVA: 0x000569F4 File Offset: 0x00054DF4
		public bool Equals(Tuple<T1, T2> other)
		{
			EqualityComparer<T1> @default = EqualityComparer<T1>.Default;
			EqualityComparer<T2> default2 = EqualityComparer<T2>.Default;
			return @default.Equals(this.item1, other.item1) && default2.Equals(this.item2, other.item2);
		}

		// Token: 0x04000B49 RID: 2889
		private T1 item1;

		// Token: 0x04000B4A RID: 2890
		private T2 item2;
	}
}
